<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2016/3/4
 * Time: 14:09
 */
namespace Collection\Controller;
use Think\Controller;

class CollectionController extends Controller {

    public function collectionlist(){

        $title = I('title');

        if($title){
            $map['title'] = array('like', '%' . (string) $title . '%');
        }

        $goods = D('Fruitdata')->where($map)->order('unit desc')->select();
        for($i=0;$i<count($goods);$i++){
            $goods[$i]['createAt']=substr($goods[$i]['createAt'],0,10);
        }
        $this->assign('_list',$goods);
        $this->display();
        /*if(IS_POST){
            echo 'POST';
            $title=I('title');
            dump($title);
            $this->display();
        }else{
            echo 'GET';
            $goods=D('Fruitdata')->select();
            $this->display();
        }*/

    }

}